/**
 * File: ReadType.java
 * Created by: mhaimel
 * Created on: Apr 16, 2010
 * CVS:  $Id: ReadType.java 1.0 Apr 16, 2010 4:06:36 PM mhaimel Exp $
 */
package uk.ac.ebi.curtain.utils.data;


/**
 * @author mhaimel
 *
 */
public enum ReadType {
	ShortPaired(true),
	Short(false),
	LongPaired(true),
	Long(false),
	Contig(false);
	
	private static final ReadType[] _pairedReads = new ReadType[]{ShortPaired,LongPaired};
	private static final ReadType[] _unpairedReads = new ReadType[]{Short,Long};
	private static final ReadType[] _longReads = new ReadType[]{LongPaired,Long};
	private static final ReadType[] _shortReads = new ReadType[]{ShortPaired,Short};
	private static final ReadType[] _allReads = new ReadType[]{ShortPaired,Short,LongPaired,Long};
	private static final ReadType[] _velvetParameterOrder = new ReadType[]{Short,ShortPaired, Long, LongPaired};
	private boolean paired;

	private ReadType(boolean paired){
		this.paired = paired;
	}
	
	public static ReadType[] getPaired(){
		return _pairedReads;
	}
	public static ReadType[] getUnpaired(){
		return _unpairedReads;
	}
	public static ReadType[] getLong(){
		return _longReads;
	}
	public static ReadType[] getShort(){
		return _shortReads;
	}
	
	public static ReadType[] getVelvetParameterOrder(){
		return _velvetParameterOrder;
	}
	
	public static ReadType[] getAllRead(){
		return _allReads;
	}
	
	public static ReadType[] getContig(){
		return new ReadType[]{Contig};
	}
	
	public boolean isPaired(){
		return paired;
	}

	public boolean isIn(ReadType ... typeArr){
		for(ReadType type : typeArr){
			if(this.equals(type)){
				return true;
			}
		}
		return false;
	}


}
